<script setup lang='ts' name="protocol-mgt-detail">
import { toRefs, watch } from 'vue'

const props = withDefaults(defineProps<{
    data?: any
    modelValue: boolean
}>(), {
    data: () => {},
})

const emits = defineEmits(['update:modelValue', 'confirm'])

const { data } = toRefs(props)

let detail = reactive<any>({})

function goToList() {
    emits('update:modelValue', true)
    emits('confirm', detail.id)
}

watch(data, (val: any) => {
    console.log('detail', val)
    detail = val
}, {
    deep: true,
    immediate: true,
})
</script>

<template>
    <el-card class="mb-20">
        <el-form :model="detail"
                 label-width="auto"
        >
            <el-row :gutter="20">
                <el-col :span="4">
                    <el-form-item label="省:">
                        {{ detail.qiyh }}
                    </el-form-item>
                </el-col>

                <el-col :span="4">
                    <el-form-item label="市:">
                        {{ detail.qiymc }}
                    </el-form-item>
                </el-col>

                <el-col :span="4">
                    <el-form-item label="区:">
                        {{ detail.qiyjc }}
                    </el-form-item>
                </el-col>
            </el-row>

            <el-form-item label="政策文件内容:">
                {{ detail.tongyxydm }}
            </el-form-item>

            <el-form-item label="是否删除:">
                <ElTag type="success">
                    是
                </ElTag>
            </el-form-item>

            <el-form-item label="排序号:">
                {{ detail.tongyxydm }}
            </el-form-item>

            <div style="text-align: center;margin-top: 20px;">
                <el-button @click="goToList">
                    返回
                </el-button>
            </div>
        </el-form>
    </el-card>
</template>

<style lang="less" scoped>
.info-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 60px;
}
</style>
